bondscell_results@$921bba30-dcbc-11ea-13c3-87554722da8aqueued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڎ2Dhpersist_js_state·has_pluto_hook_features§cell_id$921bba30-dcbc-11ea-13c3-87554722da8adepends_on_disabled_cells§runtime?published_object_keysdepends_on_skipped_cells§errored$5c4a5f22-d471-11ea-260f-9338d8bfa2d6queued¤logsrunning¦outputbody

Keep working on it!

Let's fix the above cell before we move on! Find the formula to calculate the area using pi and r.

mimetext/htmlrootassigneelast_run_timestampAڎ2H|persist_js_state·has_pluto_hook_features§cell_id$5c4a5f22-d471-11ea-260f-9338d8bfa2d6depends_on_disabled_cells§runtimecpublished_object_keysdepends_on_skipped_cells§errored$8cada086-daa5-11ea-220c-0f660938b604queued¤logsrunning¦outputbody
mimetext/htmlrootassigneelast_run_timestampAڎ2Bjpersist_js_state·has_pluto_hook_features§cell_id$8cada086-daa5-11ea-220c-0f660938b604depends_on_disabled_cells§runtimeMퟵpublished_object_keysdepends_on_skipped_cells§errored$f907e46a-d471-11ea-07e5-f30e2aab3d08queued¤logsrunning¦outputbodyY

The diameter of a pizza is often stated on a menu so let's define a formula to calculate the area of a pizza given the diameter d.

We do this by writing a formula like this: area(d) = pi * (d/2)^2

Let's write that below:

mimetext/htmlrootassigneelast_run_timestampAڎ/Hspersist_js_state·has_pluto_hook_features§cell_id$f907e46a-d471-11ea-07e5-f30e2aab3d08depends_on_disabled_cells§runtimet4published_object_keysdepends_on_skipped_cells§errored$edb95b14-d473-11ea-3a5a-77382d31f941queued¤logsrunning¦outputbody

Finding the best pizza deal

Let's see if a larger pizza is a better value by calculating the price per area. There are 4 sizes: small, medium, large, extra large with the following prices:

SizeDiameter (inches)Price ($)
small913.10
medium1320.95
large1524.90
XL1730.95

1. How many small pizzas is the same as one XL pizza?

Edit the expression below:

mimetext/htmlrootassigneelast_run_timestampAڎ/IVpersist_js_state·has_pluto_hook_features§cell_id$edb95b14-d473-11ea-3a5a-77382d31f941depends_on_disabled_cells§runtimee[ѵpublished_object_keysdepends_on_skipped_cells§errored$70e85498-d500-11ea-35af-474574f5c011queued¤logsrunning¦outputbody1mimetext/plainrootassigneetwo_medium_deallast_run_timestampAڎ2Wypersist_js_state·has_pluto_hook_features§cell_id$70e85498-d500-11ea-35af-474574f5c011depends_on_disabled_cells§runtime#published_object_keysdepends_on_skipped_cells§errored$e5e0a0da-d45c-11ea-1042-e9b5d0654d4fqueued¤logsrunning¦outputbodyo

Fix the value of c below to make it c = a * b

mimetext/htmlrootassigneelast_run_timestampAڎ/H' persist_js_state·has_pluto_hook_features§cell_id$e5e0a0da-d45c-11ea-1042-e9b5d0654d4fdepends_on_disabled_cells§runtimefpublished_object_keysdepends_on_skipped_cells§errored$cb419286-d4ff-11ea-1d7f-af5c8574b775queued¤logsrunning¦outputbodyJ

3. Is this a good deal?

San Marinos has a special "Buy two medium pizzas and save $5". Is this a better deal than buying a extra-large pizza?

Calculate the total cost of two medium pizzas deal (saving $5):

mimetext/htmlrootassigneelast_run_timestampAڎ/Iŗpersist_js_state·has_pluto_hook_features§cell_id$cb419286-d4ff-11ea-1d7f-af5c8574b775depends_on_disabled_cells§runtime4published_object_keysdepends_on_skipped_cells§errored$2ea7f162-d460-11ea-0e8e-25340e2e64daqueued¤logsrunning¦outputbody2.5mimetext/plainrootassigneeavglast_run_timestampAڎ1Dpersist_js_state·has_pluto_hook_features§cell_id$2ea7f162-d460-11ea-0e8e-25340e2e64dadepends_on_disabled_cells§runtime*published_object_keysdepends_on_skipped_cells§errored$d9575e9c-d472-11ea-1eda-2d335d039f28queued¤logsrunning¦outputbody!

Now we have a function called area that we can pass any diameter and it will return the area of a pizza (or circle), let's try that with the pizza from before with area(2*r) to get the area of the pizza:

mimetext/htmlrootassigneelast_run_timestampAڎ/Hpersist_js_state·has_pluto_hook_features§cell_id$d9575e9c-d472-11ea-1eda-2d335d039f28depends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$cb36a9ee-d472-11ea-1835-bf7963137e18queued¤logsrunning¦outputbody%area (generic function with 1 method)mimetext/plainrootassigneelast_run_timestampAڎ2persist_js_state·has_pluto_hook_features§cell_id$cb36a9ee-d472-11ea-1835-bf7963137e18depends_on_disabled_cells§runtimeϵpublished_object_keysdepends_on_skipped_cells§errored$4119d19e-dcbc-11ea-3ec8-271e88e1afcaqueued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڎ2Chpersist_js_state·has_pluto_hook_features§cell_id$4119d19e-dcbc-11ea-3ec8-271e88e1afcadepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$76c11174-d474-11ea-29c5-81856d47cf74queued¤logsrunning¦outputbody0.15783649977634118mimetext/plainrootassigneemediumlast_run_timestampAڎ2 gpersist_js_state·has_pluto_hook_features§cell_id$76c11174-d474-11ea-29c5-81856d47cf74depends_on_disabled_cells§runtime4published_object_keysdepends_on_skipped_cells§errored$f5f89724-d507-11ea-0a93-6d904f36bbe4queued¤logsrunning¦outputbody'pieces (generic function with 1 method)mimetext/plainrootassigneelast_run_timestampAڎ2"npersist_js_state·has_pluto_hook_features§cell_id$f5f89724-d507-11ea-0a93-6d904f36bbe4depends_on_disabled_cells§runtimeŵpublished_object_keysdepends_on_skipped_cells§errored$97bfd13c-dcc2-11ea-0067-ad8c2c6517fcqueued¤logsrunning¦outputbody}

To get an extra hint, figure out how many slices we can get from 5 cuts:

mimetext/htmlrootassigneelast_run_timestampAڎ/J#persist_js_state·has_pluto_hook_features§cell_id$97bfd13c-dcc2-11ea-0067-ad8c2c6517fcdepends_on_disabled_cells§runtime˵published_object_keysdepends_on_skipped_cells§errored$48647ab2-daa5-11ea-0494-ef87be7cbf7cqueued¤logsrunning¦outputbody

Hint

A new cut will create the maximum number of new slices if it intersects all previous cuts.

mimetext/htmlrootassigneelast_run_timestampAڎ2Abpersist_js_state·has_pluto_hook_features§cell_id$48647ab2-daa5-11ea-0494-ef87be7cbf7cdepends_on_disabled_cells§runtimeOipublished_object_keysdepends_on_skipped_cells§errored$5a6d1a8e-dcbc-11ea-272a-6f769c8d309cqueued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڎ2EgMpersist_js_state·has_pluto_hook_features§cell_id$5a6d1a8e-dcbc-11ea-272a-6f769c8d309cdepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$a679bddc-d506-11ea-143a-6d4dcd70e918queued¤logsrunning¦outputbodyٔ

Hint

Try drawing it out on a piece of paper.

mimetext/htmlrootassigneelast_run_timestampAڎ2J#persist_js_state·has_pluto_hook_features§cell_id$a679bddc-d506-11ea-143a-6d4dcd70e918depends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$a07e5c3e-d476-11ea-308c-718f8f128334queued¤logsrunning¦outputbody

Hint

Keep trying to get the right answer. Hint: you need to multiply the radius by 2 to convert it into the diameter.

mimetext/htmlrootassigneelast_run_timestampAڎ2I3'persist_js_state·has_pluto_hook_features§cell_id$a07e5c3e-d476-11ea-308c-718f8f128334depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$14158eb0-d45c-11ea-088f-330e45412320queued¤logsrunning¦outputbody2mimetext/plainrootassigneealast_run_timestampAڎ1kѰpersist_js_state·has_pluto_hook_features§cell_id$14158eb0-d45c-11ea-088f-330e45412320depends_on_disabled_cells§runtime"published_object_keysdepends_on_skipped_cells§errored$20a1e9cc-d500-11ea-3d9b-279c71bc20f1queued¤logsrunning¦outputbodyً

Now calculate cost per area by taking the total cost of two medium pizzas and divide by the total area:

mimetext/htmlrootassigneelast_run_timestampAڎ/J`persist_js_state·has_pluto_hook_features§cell_id$20a1e9cc-d500-11ea-3d9b-279c71bc20f1depends_on_disabled_cells§runtimeipublished_object_keysdepends_on_skipped_cells§errored$e80986c6-d509-11ea-12e3-f79a54b5ab31queued¤logsrunning¦outputbodymsg8TypeError: non-boolean (Missing) used in boolean contextstacktracecall_shorttop-level scopeinlined£urlpathu/home/fons/featured-slider-server/featured_fix/src/basic/Basic mathematics.jl#==#e80986c6-d509-11ea-12e3-f79a54b5ab31source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile

Move the slider to change the number of cuts:

mimetext/htmlrootassigneelast_run_timestampAڎ22tpersist_js_state·has_pluto_hook_features§cell_id$bd9f3d24-d509-11ea-165d-3d465a0b4542depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$6ae748b2-d503-11ea-1c51-6b2df24fd212queued¤logsrunning¦outputbodyٟ

Hint

The cuts must go all the way across the pizza!

mimetext/htmlrootassigneelast_run_timestampAڎ2Jzpersist_js_state·has_pluto_hook_features§cell_id$6ae748b2-d503-11ea-1c51-6b2df24fd212depends_on_disabled_cells§runtime !published_object_keysdepends_on_skipped_cells§errored$04b010c0-d473-11ea-1767-136c7e26e122queued¤logsrunning¦outputbody28.274333882308138mimetext/plainrootassigneeA2last_run_timestampAڎ2 Opersist_js_state·has_pluto_hook_features§cell_id$04b010c0-d473-11ea-1767-136c7e26e122depends_on_disabled_cells§runtime-Ppublished_object_keysdepends_on_skipped_cells§errored$d9c31dfa-d470-11ea-23b2-838975b71f7cqueued¤logsrunning¦outputbody

Writing your own math functions

The area of a pizza is $A = \pi r^2$. Lets try calculating the area of a pizza that has a radius of 6 inches (r = 6). Type pi to get the value of $\pi$ and r^2 to get the radius squared.

mimetext/htmlrootassigneelast_run_timestampAڎ1$persist_js_state·has_pluto_hook_features§cell_id$d9c31dfa-d470-11ea-23b2-838975b71f7cdepends_on_disabled_cells§runtime@published_object_keysdepends_on_skipped_cells§errored$962e6b86-d474-11ea-11a6-a1d11e33ae42queued¤logsrunning¦outputbody0.1363555844621221mimetext/plainrootassigneexllast_run_timestampAڎ2 npersist_js_state·has_pluto_hook_features§cell_id$962e6b86-d474-11ea-11a6-a1d11e33ae42depends_on_disabled_cells§runtime18published_object_keysdepends_on_skipped_cells§errored$03249876-d508-11ea-16bb-fd5afed37a1fqueued¤logsrunning¦outputbodyl
Let's test your formula!
mimetext/htmlrootassigneelast_run_timestampAڎ/K2 persist_js_state·has_pluto_hook_features§cell_id$03249876-d508-11ea-16bb-fd5afed37a1fdepends_on_disabled_cells§runtime)published_object_keysdepends_on_skipped_cells§errored$2814a1d4-dcc0-11ea-3d42-f52765e478fequeued¤logsrunning¦outputbody

Hint

For each extra cut, start out with the solution for the previous number. When you add one extra cut, how many new slices do you get?

mimetext/htmlrootassigneelast_run_timestampAڎ2?1persist_js_state·has_pluto_hook_features§cell_id$2814a1d4-dcc0-11ea-3d42-f52765e478fedepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$8b12d200-d474-11ea-3035-01eccf39f917queued¤logsrunning¦outputbody0.14090517628402466mimetext/plainrootassigneelargelast_run_timestampAڎ2 tpersist_js_state·has_pluto_hook_features§cell_id$8b12d200-d474-11ea-3035-01eccf39f917depends_on_disabled_cells§runtime0 published_object_keysdepends_on_skipped_cells§errored$6494e270-d503-11ea-38a7-df96e7f0a241queued¤logsrunning¦outputbody1mimetext/plainrootassigneecuts2last_run_timestampAڎ2-persist_js_state·has_pluto_hook_features§cell_id$6494e270-d503-11ea-38a7-df96e7f0a241depends_on_disabled_cells§runtime"published_object_keysdepends_on_skipped_cells§errored$f147b6cc-d4ff-11ea-05ad-6f5b441e5d1bqueued¤logsrunning¦outputbody20.95mimetext/plainrootassigneetwo_medium_costlast_run_timestampAڎ2 \persist_js_state·has_pluto_hook_features§cell_id$f147b6cc-d4ff-11ea-05ad-6f5b441e5d1bdepends_on_disabled_cells§runtime0published_object_keysdepends_on_skipped_cells§errored$33b1975c-d45c-11ea-035f-ab76e46a31edqueued¤logsrunning¦outputbodyٜ

Keep working on it!

The answer is not quite right.

mimetext/htmlrootassigneelast_run_timestampAڎ2Fpersist_js_state·has_pluto_hook_features§cell_id$33b1975c-d45c-11ea-035f-ab76e46a31eddepends_on_disabled_cells§runtime0published_object_keysdepends_on_skipped_cells§errored$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6queued¤logsrunning¦outputbody

Hint

No need to copy these digits yourself - what should we assign to best_value?

mimetext/htmlrootassigneelast_run_timestampAڎ2J(5persist_js_state·has_pluto_hook_features§cell_id$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6depends_on_disabled_cells§runtimedtpublished_object_keysdepends_on_skipped_cells§errored$a42e4eb0-d474-11ea-316a-3d864451bc01queued¤logsrunning¦outputbodyٝ

Which size of pizza is the best deal? Write your answer below and assign it to the variable best_value.

mimetext/htmlrootassigneelast_run_timestampAڎ/Ixpersist_js_state·has_pluto_hook_features§cell_id$a42e4eb0-d474-11ea-316a-3d864451bc01depends_on_disabled_cells§runtimeYLpublished_object_keysdepends_on_skipped_cells§errored$e0cb2822-dcc2-11ea-2c85-5748bfe526dcqueued¤logsrunning¦outputbody]

Have you found the pattern? Write down the formula below:

mimetext/htmlrootassigneelast_run_timestampAڎ/KӰpersist_js_state·has_pluto_hook_features§cell_id$e0cb2822-dcc2-11ea-2c85-5748bfe526dcdepends_on_disabled_cells§runtimeõpublished_object_keysdepends_on_skipped_cells§errored$2eb9a560-d507-11ea-3b8b-9d06678fe131queued¤logsrunning¦outputbodyb

Now, how many pieces can be made with 4 cuts?

mimetext/htmlrootassigneelast_run_timestampAڎ/J;persist_js_state·has_pluto_hook_features§cell_id$2eb9a560-d507-11ea-3b8b-9d06678fe131depends_on_disabled_cells§runtime;published_object_keysdepends_on_skipped_cells§errored$50f0f6d6-d471-11ea-304e-8f72e7ef9d7equeued¤logsrunning¦outputbody36mimetext/plainrootassigneeAlast_run_timestampAڎ1persist_js_state·has_pluto_hook_features§cell_id$50f0f6d6-d471-11ea-304e-8f72e7ef9d7edepends_on_disabled_cells§runtime.hpublished_object_keysdepends_on_skipped_cells§errored$3da812c6-d460-11ea-0170-79fbb6a4347cqueued¤logsrunning¦outputbody8mimetext/plainrootassigneesliceslast_run_timestampAڎ1dðpersist_js_state·has_pluto_hook_features§cell_id$3da812c6-d460-11ea-0170-79fbb6a4347cdepends_on_disabled_cells§runtime$hpublished_object_keysdepends_on_skipped_cells§errored$5b07b8fe-d475-11ea-01aa-6b88d6ed8a05queued¤logsrunning¦outputbodyن

2. Calculate the cost per area of each pizza:

mimetext/htmlrootassigneelast_run_timestampAڎ/Iwpersist_js_state·has_pluto_hook_features§cell_id$5b07b8fe-d475-11ea-01aa-6b88d6ed8a05depends_on_disabled_cells§runtimeڵpublished_object_keysdepends_on_skipped_cells§errored$30f0f882-d45c-11ea-2adc-7d84ecf8a7a6queued¤logsrunning¦outputbody10mimetext/plainrootassigneeclast_run_timestampAڎ1persist_js_state·has_pluto_hook_features§cell_id$30f0f882-d45c-11ea-2adc-7d84ecf8a7a6depends_on_disabled_cells§runtime#Ppublished_object_keysdepends_on_skipped_cells§errored$f26d50da-d46b-11ea-0c2d-77ca13532b3dqueued¤logsrunning¦outputbodyٜ

Keep working on it!

The answer is not quite right.

mimetext/htmlrootassigneelast_run_timestampAڎ2Gxpersist_js_state·has_pluto_hook_features§cell_id$f26d50da-d46b-11ea-0c2d-77ca13532b3ddepends_on_disabled_cells§runtimeQ71published_object_keysdepends_on_skipped_cells§errored$16ec3f32-d4ff-11ea-20e2-5bc6dd5db083queued¤logsrunning¦outputbody0.2059189880991436mimetext/plainrootassigneebest_valuelast_run_timestampAڎ2 Apersist_js_state·has_pluto_hook_features§cell_id$16ec3f32-d4ff-11ea-20e2-5bc6dd5db083depends_on_disabled_cells§runtime%published_object_keysdepends_on_skipped_cells§errored$d1e3dec0-d507-11ea-1213-d37a9325ee2fqueued¤logsrunning¦outputbodyu

Are you starting to see a pattern? Can you figure out a formula for how many pieces of pizza can be made with "n" cuts? Make a table and fill in the number of pieces for a number of cuts and see if you can find the pattern:

CutsPieces
01
12
24
3
4
mimetext/htmlrootassigneelast_run_timestampAڎ/J5persist_js_state·has_pluto_hook_features§cell_id$d1e3dec0-d507-11ea-1213-d37a9325ee2fdepends_on_disabled_cells§runtime Apublished_object_keysdepends_on_skipped_cells§errored$57f024ae-d500-11ea-1cc4-ed28348fdf93queued¤logsrunning¦outputbody~

Is it a better deal to get two medium pizzas for $5 off or to just buy an extra-large?

mimetext/htmlrootassigneelast_run_timestampAڎ/J$Ѱpersist_js_state·has_pluto_hook_features§cell_id$57f024ae-d500-11ea-1cc4-ed28348fdf93depends_on_disabled_cells§runtime3۵published_object_keysdepends_on_skipped_cells§errored$180c8fdc-d503-11ea-04ca-bf2c07fd1c17queued¤logsrunning¦outputbody(

4. Advanced Problem

A new worker at a pizza shop was getting paid for cutting pizza into pieces. The pieces of pizza could be any size. Calculate the maximum number of pieces the worker could make with two cuts of the pizza.

mimetext/htmlrootassigneelast_run_timestampAڎ/JH8persist_js_state·has_pluto_hook_features§cell_id$180c8fdc-d503-11ea-04ca-bf2c07fd1c17depends_on_disabled_cells§runtimeõpublished_object_keysdepends_on_skipped_cells§errored$444e2fa4-d460-11ea-12aa-57e0576c2d66queued¤logsrunning¦outputbody1mimetext/plainrootassigneepizzaslast_run_timestampAڎ1󡡰persist_js_state·has_pluto_hook_features§cell_id$444e2fa4-d460-11ea-12aa-57e0576c2d66depends_on_disabled_cells§runtime#published_object_keysdepends_on_skipped_cells§errored$03664f5c-d45c-11ea-21b6-91cd647a07aaqueued¤logsrunning¦outputbody

Mathematics in Julia 🍕

This is an introduction to programming. Let's get started!

Let's make a calculator!

First let's do some simple math with setting a = 2, b = 6 and c = a * b. What will c equal?

Type in the cells (with the coloured background) below and press Shift-Enter or the click the right-arrow button (▶️) to the right to execute the cell after changing the values.

mimetext/htmlrootassigneelast_run_timestampAڎ1"persist_js_state·has_pluto_hook_features§cell_id$03664f5c-d45c-11ea-21b6-91cd647a07aadepends_on_disabled_cells§runtimeYpublished_object_keysdepends_on_skipped_cells§errored$3823d09e-d474-11ea-194e-59b5805f303bqueued¤logsrunning¦outputbody0.2059189880991436mimetext/plainrootassigneesmalllast_run_timestampAڎ2 Bpersist_js_state·has_pluto_hook_features§cell_id$3823d09e-d474-11ea-194e-59b5805f303bdepends_on_disabled_cells§runtime5published_object_keysdepends_on_skipped_cells§errored$262b312a-d460-11ea-26c5-df30459effc5queued¤logsrunning¦outputbody10mimetext/plainrootassigneepeoplelast_run_timestampAڎ1Yypersist_js_state·has_pluto_hook_features§cell_id$262b312a-d460-11ea-26c5-df30459effc5depends_on_disabled_cells§runtime!published_object_keysdepends_on_skipped_cells§errored$a05aae8e-d506-11ea-190f-57e9ce53b8b9queued¤logsrunning¦outputbody1mimetext/plainrootassigneecuts3last_run_timestampAڎ2۰persist_js_state·has_pluto_hook_features§cell_id$a05aae8e-d506-11ea-190f-57e9ce53b8b9depends_on_disabled_cells§runtime!published_object_keysdepends_on_skipped_cells§errored$a38cb92e-d45e-11ea-2959-05be909befb2queued¤logsrunning¦outputbodyz

Now you have a calculator!

You did multiplication above. Here's how you do other mathematical operations:

OperationType This
add+
subtract-
multiply*
divide/
power^

Pizza Slices

Let's try this out on a problem. Let's say you want to order pizzas for 10 people (people = 10) and each person wants 2.5 slices on average (avg = 2.5). A pizza has 8 slices per pizza (slices = 8). How many pizzas should you order (pizzas = ?)? So we have the following

MeaningVariable
Number of peoplepeople
Average number of slices each person eatsavg
Number of slices on a piece of pizzaslices
mimetext/htmlrootassigneelast_run_timestampAڎ1ްpersist_js_state·has_pluto_hook_features§cell_id$a38cb92e-d45e-11ea-2959-05be909befb2depends_on_disabled_cells§runtimeBGpublished_object_keysdepends_on_skipped_cells§errored$19eb2a82-d500-11ea-3782-596adc689382queued¤logsrunning¦outputbody132.73228961416876mimetext/plainrootassigneetwo_medium_arealast_run_timestampAڎ28persist_js_state·has_pluto_hook_features§cell_id$19eb2a82-d500-11ea-3782-596adc689382depends_on_disabled_cells§runtime0published_object_keysdepends_on_skipped_cells§errored$8700d986-d475-11ea-0d0e-790448cf92baqueued¤logsrunning¦outputbody1

Hint

The diameter of the XL pizza is 17 inches while the diameter of the small pizza is 9 inches. Use the area() function from before to find the area of each and divide them.

mimetext/htmlrootassigneelast_run_timestampAڎ2>İpersist_js_state·has_pluto_hook_features§cell_id$8700d986-d475-11ea-0d0e-790448cf92badepends_on_disabled_cells§runtime"ypublished_object_keysdepends_on_skipped_cells§errored$4dff4b5e-d461-11ea-29c8-d548fdb5f08bqueued¤logsrunning¦outputbody

Edit the equation below to calculate the number of pizzas to order using the variables above for people, avg, and slices:

mimetext/htmlrootassigneelast_run_timestampAڎ/HTpersist_js_state·has_pluto_hook_features§cell_id$4dff4b5e-d461-11ea-29c8-d548fdb5f08bdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$637c26fa-d475-11ea-2c5b-2b0f4775b119queued¤logsrunning¦outputbody1mimetext/plainrootassigneesmalls_in_xllast_run_timestampAڎ2 [persist_js_state·has_pluto_hook_features§cell_id$637c26fa-d475-11ea-2c5b-2b0f4775b119depends_on_disabled_cells§runtime%0published_object_keysdepends_on_skipped_cells§errored$bae0cb62-dcc2-11ea-0667-512e1c407d40queued¤logsrunning¦outputbody1mimetext/plainrootassigneecuts5last_run_timestampAڎ2Epersist_js_state·has_pluto_hook_features§cell_id$bae0cb62-dcc2-11ea-0667-512e1c407d40depends_on_disabled_cells§runtime*published_object_keysdepends_on_skipped_cells§errored$0d76d97c-d500-11ea-2433-e96c6fc43b05queued¤logsrunning¦outputbodyR

Calculate the total area of two medium pizzas:

mimetext/htmlrootassigneelast_run_timestampAڎ/IGpersist_js_state·has_pluto_hook_features§cell_id$0d76d97c-d500-11ea-2433-e96c6fc43b05depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$92b4a012-d503-11ea-15a2-1f3a446d3284queued¤logsrunning¦outputbody٠

Now what about 3 cuts across the pizza? What is the maximum number of pieces that can be made with 3 cuts?

mimetext/htmlrootassigneelast_run_timestampAڎ/JkHpersist_js_state·has_pluto_hook_features§cell_id$92b4a012-d503-11ea-15a2-1f3a446d3284depends_on_disabled_cells§runtime΋published_object_keysdepends_on_skipped_cells§errored$3c12f2b4-d471-11ea-2d37-539f061f7cf2queued¤logsrunning¦outputbody6mimetext/plainrootassigneerlast_run_timestampAڎ1

Hint

Draw it out on a piece of paper. You can make more pieces with 4 cuts.

mimetext/htmlrootassigneelast_run_timestampAڎ2K5Hpersist_js_state·has_pluto_hook_features§cell_id$5df7eefc-d507-11ea-0d1f-45b224a04774depends_on_disabled_cells§runtime zpublished_object_keysdepends_on_skipped_cells§errored$b8644fb0-daa6-11ea-1e94-9bf46e7b0fadqueued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڎ279Ppersist_js_state·has_pluto_hook_features§cell_id$b8644fb0-daa6-11ea-1e94-9bf46e7b0faddepends_on_disabled_cells§runtimegpublished_object_keysdepends_on_skipped_cells§errored±cell_dependencies@$921bba30-dcbc-11ea-13c3-87554722da8aprecedence_heuristic cell_id$921bba30-dcbc-11ea-13c3-87554722da8adownstream_cells_mapkeep_working$33b1975c-d45c-11ea-035f-ab76e46a31ed$f26d50da-d46b-11ea-0c2d-77ca13532b3d$5c4a5f22-d471-11ea-260f-9338d8bfa2d6$e80986c6-d509-11ea-12e3-f79a54b5ab31upstream_cells_map@md_strMarkdown.AdmonitionMarkdown.MDMarkdowngetindex$5c4a5f22-d471-11ea-260f-9338d8bfa2d6precedence_heuristic cell_id$5c4a5f22-d471-11ea-260f-9338d8bfa2d6downstream_cells_mapupstream_cells_map@md_strA$50f0f6d6-d471-11ea-304e-8f72e7ef9d7er$3c12f2b4-d471-11ea-2d37-539f061f7cf2picorrect$5a6d1a8e-dcbc-11ea-272a-6f769c8d309ckeep_working$921bba30-dcbc-11ea-13c3-87554722da8a^*!===getindex$8cada086-daa5-11ea-220c-0f660938b604precedence_heuristic cell_id$8cada086-daa5-11ea-220c-0f660938b604downstream_cells_mapupstream_cells_map@md_str+hint$b8644fb0-daa6-11ea-1e94-9bf46e7b0fad==cuts5$bae0cb62-dcc2-11ea-0667-512e1c407d40getindex$f907e46a-d471-11ea-07e5-f30e2aab3d08precedence_heuristic cell_id$f907e46a-d471-11ea-07e5-f30e2aab3d08downstream_cells_mapupstream_cells_map@md_strgetindex$edb95b14-d473-11ea-3a5a-77382d31f941precedence_heuristic cell_id$edb95b14-d473-11ea-3a5a-77382d31f941downstream_cells_mapupstream_cells_map@md_strgetindex$70e85498-d500-11ea-35af-474574f5c011precedence_heuristic cell_id$70e85498-d500-11ea-35af-474574f5c011downstream_cells_maptwo_medium_dealupstream_cells_map$e5e0a0da-d45c-11ea-1042-e9b5d0654d4fprecedence_heuristic cell_id$e5e0a0da-d45c-11ea-1042-e9b5d0654d4fdownstream_cells_mapupstream_cells_map@md_strgetindex$cb419286-d4ff-11ea-1d7f-af5c8574b775precedence_heuristic cell_id$cb419286-d4ff-11ea-1d7f-af5c8574b775downstream_cells_mapupstream_cells_map@md_strgetindex$2ea7f162-d460-11ea-0e8e-25340e2e64daprecedence_heuristic cell_id$2ea7f162-d460-11ea-0e8e-25340e2e64dadownstream_cells_mapavg$a38cb92e-d45e-11ea-2959-05be909befb2$f26d50da-d46b-11ea-0c2d-77ca13532b3dupstream_cells_map$d9575e9c-d472-11ea-1eda-2d335d039f28precedence_heuristic cell_id$d9575e9c-d472-11ea-1eda-2d335d039f28downstream_cells_mapupstream_cells_map@md_strgetindex$cb36a9ee-d472-11ea-1835-bf7963137e18precedence_heuristic cell_id$cb36a9ee-d472-11ea-1835-bf7963137e18downstream_cells_maparea$04b010c0-d473-11ea-1767-136c7e26e122$3823d09e-d474-11ea-194e-59b5805f303b$76c11174-d474-11ea-29c5-81856d47cf74$8b12d200-d474-11ea-3035-01eccf39f917$962e6b86-d474-11ea-11a6-a1d11e33ae42$19eb2a82-d500-11ea-3782-596adc689382upstream_cells_map^/*pi$4119d19e-dcbc-11ea-3ec8-271e88e1afcaprecedence_heuristic cell_id$4119d19e-dcbc-11ea-3ec8-271e88e1afcadownstream_cells_mapalmost$f26d50da-d46b-11ea-0c2d-77ca13532b3d$a679bddc-d506-11ea-143a-6d4dcd70e918upstream_cells_mapMarkdown.AdmonitionMarkdown.MDMarkdown$76c11174-d474-11ea-29c5-81856d47cf74precedence_heuristic cell_id$76c11174-d474-11ea-29c5-81856d47cf74downstream_cells_mapmediumupstream_cells_maparea$cb36a9ee-d472-11ea-1835-bf7963137e18/$f5f89724-d507-11ea-0a93-6d904f36bbe4precedence_heuristic cell_id$f5f89724-d507-11ea-0a93-6d904f36bbe4downstream_cells_mappieces$e80986c6-d509-11ea-12e3-f79a54b5ab31upstream_cells_map$97bfd13c-dcc2-11ea-0067-ad8c2c6517fcprecedence_heuristic cell_id$97bfd13c-dcc2-11ea-0067-ad8c2c6517fcdownstream_cells_mapupstream_cells_map@md_strgetindex$48647ab2-daa5-11ea-0494-ef87be7cbf7cprecedence_heuristic cell_id$48647ab2-daa5-11ea-0494-ef87be7cbf7cdownstream_cells_mapupstream_cells_map@md_strhint$b8644fb0-daa6-11ea-1e94-9bf46e7b0fadgetindex$5a6d1a8e-dcbc-11ea-272a-6f769c8d309cprecedence_heuristic cell_id$5a6d1a8e-dcbc-11ea-272a-6f769c8d309cdownstream_cells_mapcorrect$33b1975c-d45c-11ea-035f-ab76e46a31ed$f26d50da-d46b-11ea-0c2d-77ca13532b3d$5c4a5f22-d471-11ea-260f-9338d8bfa2d6$a07e5c3e-d476-11ea-308c-718f8f128334$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6$6ae748b2-d503-11ea-1c51-6b2df24fd212$a679bddc-d506-11ea-143a-6d4dcd70e918$5df7eefc-d507-11ea-0d1f-45b224a04774$e80986c6-d509-11ea-12e3-f79a54b5ab31upstream_cells_map@md_strMarkdown.AdmonitionMarkdown.MDMarkdowngetindex$a679bddc-d506-11ea-143a-6d4dcd70e918precedence_heuristic cell_id$a679bddc-d506-11ea-143a-6d4dcd70e918downstream_cells_mapupstream_cells_map@md_strcuts3$a05aae8e-d506-11ea-190f-57e9ce53b8b9correct$5a6d1a8e-dcbc-11ea-272a-6f769c8d309chint$b8644fb0-daa6-11ea-1e94-9bf46e7b0fad==almost$4119d19e-dcbc-11ea-3ec8-271e88e1afcagetindex$a07e5c3e-d476-11ea-308c-718f8f128334precedence_heuristic cell_id$a07e5c3e-d476-11ea-308c-718f8f128334downstream_cells_mapupstream_cells_map@md_strr$3c12f2b4-d471-11ea-2d37-539f061f7cf2piA2$04b010c0-d473-11ea-1767-136c7e26e122correct$5a6d1a8e-dcbc-11ea-272a-6f769c8d309c^hint$b8644fb0-daa6-11ea-1e94-9bf46e7b0fad!=*==getindex$14158eb0-d45c-11ea-088f-330e45412320precedence_heuristic cell_id$14158eb0-d45c-11ea-088f-330e45412320downstream_cells_mapa$03664f5c-d45c-11ea-21b6-91cd647a07aa$33b1975c-d45c-11ea-035f-ab76e46a31edupstream_cells_map$20a1e9cc-d500-11ea-3d9b-279c71bc20f1precedence_heuristic cell_id$20a1e9cc-d500-11ea-3d9b-279c71bc20f1downstream_cells_mapupstream_cells_map@md_strgetindex$e80986c6-d509-11ea-12e3-f79a54b5ab31precedence_heuristic cell_id$e80986c6-d509-11ea-12e3-f79a54b5ab31downstream_cells_mapupstream_cells_mapgetindex@md_strpieces$f5f89724-d507-11ea-0a93-6d904f36bbe4correct$5a6d1a8e-dcbc-11ea-272a-6f769c8d309ckeep_working$921bba30-dcbc-11ea-13c3-87554722da8a/Int+*==n$bd9f3d24-d509-11ea-165d-3d465a0b4542$bd9f3d24-d509-11ea-165d-3d465a0b4542precedence_heuristic cell_id$bd9f3d24-d509-11ea-165d-3d465a0b4542downstream_cells_mapn$e80986c6-d509-11ea-12e3-f79a54b5ab31upstream_cells_map@md_strBase.getindexBasePlutoRunner.Base.get@html_str#PlutoRunner.PlutoRunner.create_bondPlutoRunnerBase.Docs.HTML@bindPlutoRunner.Core.applicable$6ae748b2-d503-11ea-1c51-6b2df24fd212precedence_heuristic cell_id$6ae748b2-d503-11ea-1c51-6b2df24fd212downstream_cells_mapupstream_cells_map@md_strcuts2$6494e270-d503-11ea-38a7-df96e7f0a241correct$5a6d1a8e-dcbc-11ea-272a-6f769c8d309chint$b8644fb0-daa6-11ea-1e94-9bf46e7b0fad!===getindex$04b010c0-d473-11ea-1767-136c7e26e122precedence_heuristic cell_id$04b010c0-d473-11ea-1767-136c7e26e122downstream_cells_mapA2$a07e5c3e-d476-11ea-308c-718f8f128334upstream_cells_maparea$cb36a9ee-d472-11ea-1835-bf7963137e18r$3c12f2b4-d471-11ea-2d37-539f061f7cf2$d9c31dfa-d470-11ea-23b2-838975b71f7cprecedence_heuristic cell_id$d9c31dfa-d470-11ea-23b2-838975b71f7cdownstream_cells_mapupstream_cells_map@md_strr$3c12f2b4-d471-11ea-2d37-539f061f7cf2getindex$962e6b86-d474-11ea-11a6-a1d11e33ae42precedence_heuristic cell_id$962e6b86-d474-11ea-11a6-a1d11e33ae42downstream_cells_mapxl$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6upstream_cells_maparea$cb36a9ee-d472-11ea-1835-bf7963137e18/$03249876-d508-11ea-16bb-fd5afed37a1fprecedence_heuristic cell_id$03249876-d508-11ea-16bb-fd5afed37a1fdownstream_cells_mapupstream_cells_map@md_strgetindex$2814a1d4-dcc0-11ea-3d42-f52765e478feprecedence_heuristic cell_id$2814a1d4-dcc0-11ea-3d42-f52765e478fedownstream_cells_mapupstream_cells_map@md_strhint$b8644fb0-daa6-11ea-1e94-9bf46e7b0fadgetindex$8b12d200-d474-11ea-3035-01eccf39f917precedence_heuristic cell_id$8b12d200-d474-11ea-3035-01eccf39f917downstream_cells_maplargeupstream_cells_maparea$cb36a9ee-d472-11ea-1835-bf7963137e18/$6494e270-d503-11ea-38a7-df96e7f0a241precedence_heuristic cell_id$6494e270-d503-11ea-38a7-df96e7f0a241downstream_cells_mapcuts2$6ae748b2-d503-11ea-1c51-6b2df24fd212upstream_cells_map$f147b6cc-d4ff-11ea-05ad-6f5b441e5d1bprecedence_heuristic cell_id$f147b6cc-d4ff-11ea-05ad-6f5b441e5d1bdownstream_cells_maptwo_medium_costupstream_cells_map-*$33b1975c-d45c-11ea-035f-ab76e46a31edprecedence_heuristic cell_id$33b1975c-d45c-11ea-035f-ab76e46a31eddownstream_cells_mapupstream_cells_map@md_strcorrect$5a6d1a8e-dcbc-11ea-272a-6f769c8d309cc$30f0f882-d45c-11ea-2adc-7d84ecf8a7a6keep_working$921bba30-dcbc-11ea-13c3-87554722da8ab$2ed4bb92-d45c-11ea-0b31-2d8e32ce7b44+*==a$14158eb0-d45c-11ea-088f-330e45412320getindex$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6precedence_heuristic cell_id$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6downstream_cells_mapupstream_cells_map@md_strgetindexisapproxxl$962e6b86-d474-11ea-11a6-a1d11e33ae42correct$5a6d1a8e-dcbc-11ea-272a-6f769c8d309c!hint$b8644fb0-daa6-11ea-1e94-9bf46e7b0fadbest_value$16ec3f32-d4ff-11ea-20e2-5bc6dd5db083$a42e4eb0-d474-11ea-316a-3d864451bc01precedence_heuristic cell_id$a42e4eb0-d474-11ea-316a-3d864451bc01downstream_cells_mapupstream_cells_map@md_strgetindex$e0cb2822-dcc2-11ea-2c85-5748bfe526dcprecedence_heuristic cell_id$e0cb2822-dcc2-11ea-2c85-5748bfe526dcdownstream_cells_mapupstream_cells_map@md_strgetindex$2eb9a560-d507-11ea-3b8b-9d06678fe131precedence_heuristic cell_id$2eb9a560-d507-11ea-3b8b-9d06678fe131downstream_cells_mapupstream_cells_map@md_strgetindex$50f0f6d6-d471-11ea-304e-8f72e7ef9d7eprecedence_heuristic cell_id$50f0f6d6-d471-11ea-304e-8f72e7ef9d7edownstream_cells_mapA$5c4a5f22-d471-11ea-260f-9338d8bfa2d6upstream_cells_map^r$3c12f2b4-d471-11ea-2d37-539f061f7cf2$3da812c6-d460-11ea-0170-79fbb6a4347cprecedence_heuristic cell_id$3da812c6-d460-11ea-0170-79fbb6a4347cdownstream_cells_mapslices$a38cb92e-d45e-11ea-2959-05be909befb2$f26d50da-d46b-11ea-0c2d-77ca13532b3dupstream_cells_map$5b07b8fe-d475-11ea-01aa-6b88d6ed8a05precedence_heuristic cell_id$5b07b8fe-d475-11ea-01aa-6b88d6ed8a05downstream_cells_mapupstream_cells_map@md_strgetindex$30f0f882-d45c-11ea-2adc-7d84ecf8a7a6precedence_heuristic cell_id$30f0f882-d45c-11ea-2adc-7d84ecf8a7a6downstream_cells_mapc$33b1975c-d45c-11ea-035f-ab76e46a31edupstream_cells_map$f26d50da-d46b-11ea-0c2d-77ca13532b3dprecedence_heuristic cell_id$f26d50da-d46b-11ea-0c2d-77ca13532b3ddownstream_cells_mapupstream_cells_map@md_strceilpeople$262b312a-d460-11ea-26c5-df30459effc5pizzas$444e2fa4-d460-11ea-12aa-57e0576c2d66slices$3da812c6-d460-11ea-0170-79fbb6a4347ccorrect$5a6d1a8e-dcbc-11ea-272a-6f769c8d309cavg$2ea7f162-d460-11ea-0e8e-25340e2e64dakeep_working$921bba30-dcbc-11ea-13c3-87554722da8a/*==almost$4119d19e-dcbc-11ea-3ec8-271e88e1afcagetindex$16ec3f32-d4ff-11ea-20e2-5bc6dd5db083precedence_heuristic cell_id$16ec3f32-d4ff-11ea-20e2-5bc6dd5db083downstream_cells_mapbest_value$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6upstream_cells_mapsmall$3823d09e-d474-11ea-194e-59b5805f303b$d1e3dec0-d507-11ea-1213-d37a9325ee2fprecedence_heuristic cell_id$d1e3dec0-d507-11ea-1213-d37a9325ee2fdownstream_cells_mapupstream_cells_map@md_strgetindex$57f024ae-d500-11ea-1cc4-ed28348fdf93precedence_heuristic cell_id$57f024ae-d500-11ea-1cc4-ed28348fdf93downstream_cells_mapupstream_cells_map@md_strgetindex$180c8fdc-d503-11ea-04ca-bf2c07fd1c17precedence_heuristic cell_id$180c8fdc-d503-11ea-04ca-bf2c07fd1c17downstream_cells_mapupstream_cells_map@md_strgetindex$444e2fa4-d460-11ea-12aa-57e0576c2d66precedence_heuristic cell_id$444e2fa4-d460-11ea-12aa-57e0576c2d66downstream_cells_mappizzas$f26d50da-d46b-11ea-0c2d-77ca13532b3dupstream_cells_map$03664f5c-d45c-11ea-21b6-91cd647a07aaprecedence_heuristic cell_id$03664f5c-d45c-11ea-21b6-91cd647a07aadownstream_cells_mapupstream_cells_map@md_strb$2ed4bb92-d45c-11ea-0b31-2d8e32ce7b44a$14158eb0-d45c-11ea-088f-330e45412320getindex$3823d09e-d474-11ea-194e-59b5805f303bprecedence_heuristic cell_id$3823d09e-d474-11ea-194e-59b5805f303bdownstream_cells_mapsmall$16ec3f32-d4ff-11ea-20e2-5bc6dd5db083upstream_cells_maparea$cb36a9ee-d472-11ea-1835-bf7963137e18/$262b312a-d460-11ea-26c5-df30459effc5precedence_heuristic cell_id$262b312a-d460-11ea-26c5-df30459effc5downstream_cells_mappeople$a38cb92e-d45e-11ea-2959-05be909befb2$f26d50da-d46b-11ea-0c2d-77ca13532b3dupstream_cells_map$a05aae8e-d506-11ea-190f-57e9ce53b8b9precedence_heuristic cell_id$a05aae8e-d506-11ea-190f-57e9ce53b8b9downstream_cells_mapcuts3$a679bddc-d506-11ea-143a-6d4dcd70e918upstream_cells_map$a38cb92e-d45e-11ea-2959-05be909befb2precedence_heuristic cell_id$a38cb92e-d45e-11ea-2959-05be909befb2downstream_cells_mapupstream_cells_map@md_strslices$3da812c6-d460-11ea-0170-79fbb6a4347cavg$2ea7f162-d460-11ea-0e8e-25340e2e64dapeople$262b312a-d460-11ea-26c5-df30459effc5getindex$19eb2a82-d500-11ea-3782-596adc689382precedence_heuristic cell_id$19eb2a82-d500-11ea-3782-596adc689382downstream_cells_maptwo_medium_areaupstream_cells_maparea$cb36a9ee-d472-11ea-1835-bf7963137e18*$8700d986-d475-11ea-0d0e-790448cf92baprecedence_heuristic cell_id$8700d986-d475-11ea-0d0e-790448cf92badownstream_cells_mapupstream_cells_map@md_strsmalls_in_xl$637c26fa-d475-11ea-2c5b-2b0f4775b119>islesspieps<-/^+hint$b8644fb0-daa6-11ea-1e94-9bf46e7b0fad*==getindex$4dff4b5e-d461-11ea-29c8-d548fdb5f08bprecedence_heuristic cell_id$4dff4b5e-d461-11ea-29c8-d548fdb5f08bdownstream_cells_mapupstream_cells_map@md_strgetindex$637c26fa-d475-11ea-2c5b-2b0f4775b119precedence_heuristic cell_id$637c26fa-d475-11ea-2c5b-2b0f4775b119downstream_cells_mapsmalls_in_xl$8700d986-d475-11ea-0d0e-790448cf92baupstream_cells_map$bae0cb62-dcc2-11ea-0667-512e1c407d40precedence_heuristic cell_id$bae0cb62-dcc2-11ea-0667-512e1c407d40downstream_cells_mapcuts5$8cada086-daa5-11ea-220c-0f660938b604upstream_cells_map$0d76d97c-d500-11ea-2433-e96c6fc43b05precedence_heuristic cell_id$0d76d97c-d500-11ea-2433-e96c6fc43b05downstream_cells_mapupstream_cells_map@md_strgetindex$92b4a012-d503-11ea-15a2-1f3a446d3284precedence_heuristic cell_id$92b4a012-d503-11ea-15a2-1f3a446d3284downstream_cells_mapupstream_cells_map@md_strgetindex$3c12f2b4-d471-11ea-2d37-539f061f7cf2precedence_heuristic cell_id$3c12f2b4-d471-11ea-2d37-539f061f7cf2downstream_cells_mapr$d9c31dfa-d470-11ea-23b2-838975b71f7c$50f0f6d6-d471-11ea-304e-8f72e7ef9d7e$5c4a5f22-d471-11ea-260f-9338d8bfa2d6$04b010c0-d473-11ea-1767-136c7e26e122$a07e5c3e-d476-11ea-308c-718f8f128334upstream_cells_map$2ed4bb92-d45c-11ea-0b31-2d8e32ce7b44precedence_heuristic cell_id$2ed4bb92-d45c-11ea-0b31-2d8e32ce7b44downstream_cells_mapb$03664f5c-d45c-11ea-21b6-91cd647a07aa$33b1975c-d45c-11ea-035f-ab76e46a31edupstream_cells_map$5a8ede88-d507-11ea-30d9-c99a67243781precedence_heuristic cell_id$5a8ede88-d507-11ea-30d9-c99a67243781downstream_cells_mapcuts4$5df7eefc-d507-11ea-0d1f-45b224a04774upstream_cells_map$5df7eefc-d507-11ea-0d1f-45b224a04774precedence_heuristic cell_id$5df7eefc-d507-11ea-0d1f-45b224a04774downstream_cells_mapupstream_cells_map@md_str")"""metadatashow_logsèdisabled®skip_as_script«code_folded$6ae748b2-d503-11ea-1c51-6b2df24fd212cell_id$6ae748b2-d503-11ea-1c51-6b2df24fd212codehif cuts2 != 4 hint(md"The cuts must go all the way across the pizza!") else correct(md"Awesome!") endmetadatashow_logsèdisabled®skip_as_script«code_folded$04b010c0-d473-11ea-1767-136c7e26e122cell_id$04b010c0-d473-11ea-1767-136c7e26e122codeA2 = area(r)metadatashow_logsèdisabled®skip_as_script«code_folded$d9c31dfa-d470-11ea-23b2-838975b71f7ccell_id$d9c31dfa-d470-11ea-23b2-838975b71f7ccodemd"""## Writing your own math functions The area of a pizza is ``A = \pi r^2``. Lets try calculating the area of a pizza that has a radius of $r inches (**r = $r**). Type **pi** to get the value of ``\pi`` and **r^2** to get the radius squared. """metadatashow_logsèdisabled®skip_as_script«code_folded$962e6b86-d474-11ea-11a6-a1d11e33ae42cell_id$962e6b86-d474-11ea-11a6-a1d11e33ae42codexl = 30.95 / area(17)metadatashow_logsèdisabled®skip_as_script«code_folded$03249876-d508-11ea-16bb-fd5afed37a1fcell_id$03249876-d508-11ea-16bb-fd5afed37a1fcode&md"""##### Let's test your formula!"""metadatashow_logsèdisabled®skip_as_script«code_folded$2814a1d4-dcc0-11ea-3d42-f52765e478fecell_id$2814a1d4-dcc0-11ea-3d42-f52765e478fecodeَhint(md"For each extra cut, start out with the solution for the previous number. When you add one extra cut, how many new slices do you get?")metadatashow_logsèdisabled®skip_as_script«code_folded$8b12d200-d474-11ea-3035-01eccf39f917cell_id$8b12d200-d474-11ea-3035-01eccf39f917codelarge = 24.90 / area(15)metadatashow_logsèdisabled®skip_as_script«code_folded$6494e270-d503-11ea-38a7-df96e7f0a241cell_id$6494e270-d503-11ea-38a7-df96e7f0a241codecuts2 = 1metadatashow_logsèdisabled®skip_as_script«code_folded$f147b6cc-d4ff-11ea-05ad-6f5b441e5d1bcell_id$f147b6cc-d4ff-11ea-05ad-6f5b441e5d1bcodetwo_medium_cost = 20.95 * 1 - 0metadatashow_logsèdisabled®skip_as_script«code_folded$33b1975c-d45c-11ea-035f-ab76e46a31edcell_id$33b1975c-d45c-11ea-035f-ab76e46a31edcodeAif c == a * b correct(md"""**Great!** The value of c = $c. So you now have a simple computer! Now go back above and change the value of **a = $a** to **a = $(a + 3)** and press **`Shift-Enter`**. What is the new value of **c**? Notice how all the values get updated in this notebook! """) else keep_working() endmetadatashow_logsèdisabled®skip_as_script«code_folded$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6cell_id$1ba2c208-d4ff-11ea-0a8e-e75bf7e1c3e6codeٌif !isapprox(best_value, xl) hint(md"No need to copy these digits yourself - what should we assign to **best_value**?") else correct() endmetadatashow_logsèdisabled®skip_as_script«code_folded$a42e4eb0-d474-11ea-316a-3d864451bc01cell_id$a42e4eb0-d474-11ea-316a-3d864451bc01codepmd"Which size of pizza is the best deal? Write your answer below and assign it to the variable **best_value**."metadatashow_logsèdisabled®skip_as_script«code_folded$e0cb2822-dcc2-11ea-2c85-5748bfe526dccell_id$e0cb2822-dcc2-11ea-2c85-5748bfe526dccode=md"Have you found the pattern? Write down the formula below:"metadatashow_logsèdisabled®skip_as_script«code_folded$2eb9a560-d507-11ea-3b8b-9d06678fe131cell_id$2eb9a560-d507-11ea-3b8b-9d06678fe131code5md"Now, how many pieces can be made with **4 cuts**?"metadatashow_logsèdisabled®skip_as_script«code_folded$50f0f6d6-d471-11ea-304e-8f72e7ef9d7ecell_id$50f0f6d6-d471-11ea-304e-8f72e7ef9d7ecodeA = r^2metadatashow_logsèdisabled®skip_as_script«code_folded$3da812c6-d460-11ea-0170-79fbb6a4347ccell_id$3da812c6-d460-11ea-0170-79fbb6a4347ccodeslices = 8metadatashow_logsèdisabled®skip_as_script«code_folded$5b07b8fe-d475-11ea-01aa-6b88d6ed8a05cell_id$5b07b8fe-d475-11ea-01aa-6b88d6ed8a05code:md"""### 2. Calculate the cost per area of each pizza: """metadatashow_logsèdisabled®skip_as_script«code_folded$30f0f882-d45c-11ea-2adc-7d84ecf8a7a6cell_id$30f0f882-d45c-11ea-2adc-7d84ecf8a7a6codec = 10metadatashow_logsèdisabled®skip_as_script«code_folded$f26d50da-d46b-11ea-0c2d-77ca13532b3dcell_id$f26d50da-d46b-11ea-0c2d-77ca13532b3dcodeqif pizzas == people * avg / slices almost(md"Yes that is right! But we should round $pizzas up to an integer, otherwise the restaurant will be confused. Try `ceil(...)`!") elseif pizzas == ceil(people * avg / slices) correct(md"Yes that is right, that's a lot of pizza! Excellent, you figured out we need to round up the number of pizzas!") else keep_working() endmetadatashow_logsèdisabled®skip_as_script«code_folded$16ec3f32-d4ff-11ea-20e2-5bc6dd5db083cell_id$16ec3f32-d4ff-11ea-20e2-5bc6dd5db083codebest_value = smallmetadatashow_logsèdisabled®skip_as_script«code_folded$d1e3dec0-d507-11ea-1213-d37a9325ee2fcell_id$d1e3dec0-d507-11ea-1213-d37a9325ee2fcode;md"Are you starting to see a pattern? Can you figure out a formula for how many pieces of pizza can be made with \"n\" cuts? Make a table and fill in the number of pieces for a number of cuts and see if you can find the pattern: Cuts | Pieces :--- | ------: 0 | 1 1 | 2 2 | 4 3 | 4 | "metadatashow_logsèdisabled®skip_as_script«code_folded$57f024ae-d500-11ea-1cc4-ed28348fdf93cell_id$57f024ae-d500-11ea-1cc4-ed28348fdf93code_md"""Is it a better deal to get two medium pizzas for \$5 off or to just buy an extra-large?"""metadatashow_logsèdisabled®skip_as_script«code_folded$180c8fdc-d503-11ea-04ca-bf2c07fd1c17cell_id$180c8fdc-d503-11ea-04ca-bf2c07fd1c17codemd"""### 4. Advanced Problem A new worker at a pizza shop was getting paid for cutting pizza into pieces. The pieces of pizza could be any size. Calculate the maximum number of pieces the worker could make with two cuts of the pizza."""metadatashow_logsèdisabled®skip_as_script«code_folded$444e2fa4-d460-11ea-12aa-57e0576c2d66cell_id$444e2fa4-d460-11ea-12aa-57e0576c2d66codepizzas = 1metadatashow_logsèdisabled®skip_as_script«code_folded$03664f5c-d45c-11ea-21b6-91cd647a07aacell_id$03664f5c-d45c-11ea-21b6-91cd647a07aacodemd"# Mathematics in Julia 🍕 This is an introduction to programming. Let's get started! ## Let's make a calculator! First let's do some simple math with setting **a = $a**, **b = $b** and **c = a * b**. What will **c** equal? Type in the cells (with the coloured background) below and press **`Shift-Enter`** or the click the right-arrow button (▶️) to the right to execute the cell after changing the values."metadatashow_logsèdisabled®skip_as_script«code_folded$3823d09e-d474-11ea-194e-59b5805f303bcell_id$3823d09e-d474-11ea-194e-59b5805f303bcodesmall = 13.10 / area(9)metadatashow_logsèdisabled®skip_as_script«code_folded$262b312a-d460-11ea-26c5-df30459effc5cell_id$262b312a-d460-11ea-26c5-df30459effc5codepeople = 10metadatashow_logsèdisabled®skip_as_script«code_folded$a05aae8e-d506-11ea-190f-57e9ce53b8b9cell_id$a05aae8e-d506-11ea-190f-57e9ce53b8b9codecuts3 = 1metadatashow_logsèdisabled®skip_as_script«code_folded$a38cb92e-d45e-11ea-2959-05be909befb2cell_id$a38cb92e-d45e-11ea-2959-05be909befb2codemd"""### Now you have a calculator! You did multiplication above. Here's how you do other mathematical operations: Operation | Type This :------------ | :-------------: add | + subtract | - multiply | * divide | / power | ^ ### Pizza Slices Let's try this out on a problem. Let's say you want to order pizzas for $people people (**people = $people**) and each person wants $avg slices on average (**avg = $avg**). A pizza has $slices slices per pizza (**slices = $slices**). How many pizzas should you order (**pizzas = ?**)? So we have the following Meaning | Variable :------ | :--------: Number of people | people Average number of slices each person eats | avg Number of slices on a piece of pizza | slices """metadatashow_logsèdisabled®skip_as_script«code_folded$19eb2a82-d500-11ea-3782-596adc689382cell_id$19eb2a82-d500-11ea-3782-596adc689382codetwo_medium_area = 1 * area(13)metadatashow_logsèdisabled®skip_as_script«code_folded$8700d986-d475-11ea-0d0e-790448cf92bacell_id$8700d986-d475-11ea-0d0e-790448cf92bacodelet ans = (pi * (17 / 2)^2) / (pi * (9 / 2)^2) if smalls_in_xl == 1 hint(md"""The diameter of the XL pizza is 17 inches while the diameter of the small pizza is 9 inches. Use the **area()** function from before to find the area of each and divide them.""") elseif smalls_in_xl < ans - 4 * eps(ans) md"""Keep trying, your answer is too low.""" elseif smalls_in_xl > ans + 4 * eps(ans) md"""Keep trying, your answer is too high.""" else md"""**Great!** You got it right. Let's move on.""" end endmetadatashow_logsèdisabled®skip_as_script«code_folded$4dff4b5e-d461-11ea-29c8-d548fdb5f08bcell_id$4dff4b5e-d461-11ea-29c8-d548fdb5f08bcodeىmd"Edit the equation below to calculate the number of pizzas to order using the variables above for **people**, **avg**, and **slices**:"metadatashow_logsèdisabled®skip_as_script«code_folded$637c26fa-d475-11ea-2c5b-2b0f4775b119cell_id$637c26fa-d475-11ea-2c5b-2b0f4775b119codesmalls_in_xl = 1metadatashow_logsèdisabled®skip_as_script«code_folded$bae0cb62-dcc2-11ea-0667-512e1c407d40cell_id$bae0cb62-dcc2-11ea-0667-512e1c407d40codecuts5 = 1metadatashow_logsèdisabled®skip_as_script«code_folded$0d76d97c-d500-11ea-2433-e96c6fc43b05cell_id$0d76d97c-d500-11ea-2433-e96c6fc43b05code2md"Calculate the total area of two medium pizzas:"metadatashow_logsèdisabled®skip_as_script«code_folded$92b4a012-d503-11ea-15a2-1f3a446d3284cell_id$92b4a012-d503-11ea-15a2-1f3a446d3284codesmd"Now what about 3 cuts across the pizza? What is the maximum number of pieces that can be made with **3 cuts**?"metadatashow_logsèdisabled®skip_as_script«code_folded$3c12f2b4-d471-11ea-2d37-539f061f7cf2cell_id$3c12f2b4-d471-11ea-2d37-539f061f7cf2coder = 6metadatashow_logsèdisabled®skip_as_script«code_folded$2ed4bb92-d45c-11ea-0b31-2d8e32ce7b44cell_id$2ed4bb92-d45c-11ea-0b31-2d8e32ce7b44codeb = 6metadatashow_logsèdisabled®skip_as_script«code_folded$5a8ede88-d507-11ea-30d9-c99a67243781cell_id$5a8ede88-d507-11ea-30d9-c99a67243781codecuts4 = 1metadatashow_logsèdisabled®skip_as_script«code_folded$5df7eefc-d507-11ea-0d1f-45b224a04774cell_id$5df7eefc-d507-11ea-0d1f-45b224a04774codeYif cuts4 == 11 correct(md"That was a tough question. How did you figure it out? You tried hard.") elseif cuts4 < 10 hint(md"Draw it out on a piece of paper. You can make more pieces with 4 cuts.") elseif cuts4 < 11 hint(md"Getting close but you can make more pieces with 4 cuts.") else hint(md"That is too high. Only straight lines!") endmetadatashow_logsèdisabled®skip_as_script«code_folded$b8644fb0-daa6-11ea-1e94-9bf46e7b0fadcell_id$b8644fb0-daa6-11ea-1e94-9bf46e7b0fadcodeFhint(text) = Markdown.MD(Markdown.Admonition("hint", "Hint", [text]));metadatashow_logsèdisabled®skip_as_script«code_foldedënotebook_id$57bcf712-6f93-11f1-be56-dfa15f2a76f9in_temp_dir¨metadatafrontmatterlicense_urlghttps://github.com/JuliaPluto/featured/blob/2a6a9664e5428b37abe4957c1dca0994f4a8b7fd/LICENSES/UnlicenseauthornamePluto.jlurlhttps://github.com/JuliaPlutoimagedhttps://user-images.githubusercontent.com/6933510/174066114-bc76964d-6ed1-491a-baa0-5063e3b08a17.pngorder2tagsbasicclassiclicenseUnlicensedescription-Learn mathematics in Julia using pizzas! 🍕